// wgllight.hpp
//

#ifndef _WGLLIGHT_HPP
#define _WGLLIGHT_HPP

#include "wgl/wglbase.hpp"

#include "glm/vec3.hpp"
#include "glm/vec4.hpp"

namespace wgl
{
  // LightType
  //
  enum class LightType : int32_t
    {
      None        = 0,
      Directional = 1,
      Omni        = 2,
    };



  // Light
  //
  class Light
  {
  public:
    Light ( LightType type=LightType::Directional );

    LightType get_type () const { return type; }
    const glm::vec3 &get_position () const { return position; }
    glm::vec3 get_ambient () const { return glm::vec3(ambient) * ambient.w; }
    glm::vec3 get_diffuse () const { return glm::vec3(diffuse) * diffuse.w; }
    glm::vec3 get_specular () const { return glm::vec3(specular) * specular.w; }

    void set_type ( LightType type );
    void set_position ( glm::vec3 position );
    void set_color ( glm::vec3 color );
    void set_levels ( float ambient,
                      float diffuse,
                      float specular );
    
  private:
    LightType type;
    glm::vec3 position;
    // w is strength for the 3 components
    glm::vec4 ambient;
    glm::vec4 diffuse;
    glm::vec4 specular;
  };
}

#endif
